package com.question.view.command.play;

import java.util.List;

import com.question.Design.SingletonMode;
import com.question.entity.User;
import com.question.service.IPlayerService;
import com.question.utils.InputOutUtils;
import com.question.view.Configure;

public class RankCommand extends PlayerSuper{
	private IPlayerService playerService = SingletonMode.getPlayerService();
	@Override
	protected void exec(User player) {
		List<User> list = playerService.rankUserByScoreTop10();
		if(list !=null) {
			for(int i = 0; i<list.size();i++) {
				User user = list.get(i);
				InputOutUtils.print("********top"+(i+1)+"*********",
									"昵称:"+user.getDisplay_name(),
									Configure.INTEGRAL+":"+user.getScore(),
									"答题数"+user.getAnswer(),
									"*********************");
				
			}
		}
	}

}
